import com.mapper.PersonMapper;
import com.pojo.Person;
import com.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

public class PersonTest {
    @Test
    public void findPersonByIdTest(){
        SqlSession session = MyBatisUtils.getSession();
        Person person = session.selectOne
                ("com.mapper.PersonMapper.findPersonById", 1);
        System.out.println(person);
        session.close();
    }
    @Test
    public void selectPersonByNameTest(){
        SqlSession session = MyBatisUtils.getSession();
        PersonMapper mapper = session.getMapper(PersonMapper.class);
        Person person = mapper.selectPersonById(2);
        System.out.println(person);
        session.close();
    }
}
